import { Controller, Get, Post } from '@nestjs/common';

import { CatsService } from './cats.service';
import { Cat } from './interfaces/cat.interface';

@Controller('cats')
export class CatsController {
  constructor(private catsService: CatsService) {}
  // @Get()
  // getCat() {
  //   return 'This action returns all cats';
  // }
  @Post()
  async create() {
    this.catsService.create({
      name: 'ddd',
      age: 1,
      breed: 'ddd'
    })
    return this.catsService.findAll()
  }
  @Get() 
  async findAll() {
    return this.catsService.findAll()
  }
}
